If you wish to customize the double buffering algorithm that the Sound Manager uses to manage a play from disk, you can use the SndPlayDoubleBuffer function. The Sound Manager's high-level play-from-disk routines make extensive use of this function.
The SndPlayDoubleBuffer function is a low-level routine that gives you maximum efficiency and control over double buffering while still maintaining compatibility with the Sound Manager.
FUNCTION SndPlayDoubleBuffer (chan: SndChannelPtr;
theParams: SndDoubleBufferHeaderPtr): OSErr;
The SndPlayDoubleBuffer function launches a low-level sound play using the information in the double buffer header record specified by theParams . After your application calls this function, the Sound Manager repeatedly calls the doubleback procedure you specify in the double buffer header record. The doubleback procedure then manages the filling of buffers of sound data from disk whenever one of the two buffers specified in the double buffer header record becomes exhausted.
Because the SndPlayDoubleBuffer function might move memory, you should not call it at interrupt time.
You can use the SndPlayDoubleBuffer function only on a Macintosh computer that supports the play-from-disk routines. For information on how to determine whether a computer supports these routines, see "Testing for Multichannel Sound and Play-From-Disk Capabilities" .
The trap macro and routine selector for the SndPlayDoubleBuffer function are
For information on the format of a doubleback procedure, see "Doubleback Procedures" .
| Previous | Chapter contents | Chapter top | Section top | Next |